<?php $view->extend('DomotiqueBundle:Layout:layout.html.php') ?>

<!-- Première page : les pièces -->
<div class="container" data-role="page" id="rooms">
	<div class="row" data-role="content">
		<div class="span4">
			<div class="span4 element rooms well">
				<?=$view->render('DomotiqueBundle:Elements:rooms.html.php', array("rooms" => $rooms));?>
			</div>
		</div>
	</div>
</div>

<!-- Thermostat -->
<div class="container thermostat" data-role="page" id="thermostat">
	<? echo $view->render('DomotiqueBundle:Elements:thermostat.html.php', array("thermostats" => $thermostats)); ?>
</div>

<!-- Autres pages : les elements dans les pièces -->
<? foreach($elements as $piece => $elements){
	?>
	<div class="container" data-role="page" id="room_<?=$piece?>">
		<div data-role="header"> 
			<a href="#rooms" data-role="button" data-icon="arrow-l" data-iconpos="left"> Pièces </a> 
			<h3> <?=$rooms->$piece->room_name?></h3> 
		</div> 
		<div data-role="content">
			<? foreach ($elements as $element){
				switch($element->type){
					case "strip_led":
						echo $view->render('DomotiqueBundle:Commandes:strip_led.html.php', array("element" => $element));
						break;
					case "relay": 
						echo $view->render('DomotiqueBundle:Commandes:relay.html.php', array("element" => $element));
						break;
				}
			}?>
		</div>
	</div>
	<?
}